import Vue from 'vue';
import App from './App.vue';

import Home from './components/Home.vue'
import Shop from './components/Shop.vue'
import Order from './components/Order.vue'

import VueRouter from 'vue-router';
const router = new VueRouter({
  // 路由表
  routes: [
    {
      path: '/a/b',
      component: Home,
    },
    {
      path: '/c/d',
      component: Shop,
    },
    {
      path: '/e/f',
      component: Order,
    },
  ]
});
// 注册组件 <router-view> <router-link>
Vue.use(VueRouter);


Vue.mixin({
  computed: {
    info() {
      return this.$root.$options.router
    }
  }
})

new Vue({
  el: '#app',
  router,//路由表
  info: { age: 20, gender: 'boy' },
  render: h => h(App),
});